package com.zhixun.mobile.modules.jiujiudevice.device.util;

import java.util.Map;

import com.alibaba.druid.util.StringUtils;
import com.alibaba.fastjson.JSON;

public class SocketUtils {
	
	public static String[] getParam(String param){
		param = param.replace(DeviceCodeEnums.SN.getMsg(), "");
		return param.split("&");
	}
	/**
	 * {
	"sn":"861510030498717",
	"state":"1",
	"id":"1",
	"value":"1234"
    }
	 * json字符串转map
	 * 
	 * @param json
	 * @return
	 */
	@SuppressWarnings("unchecked")
	public static Map<String, Object> jsonToMap(String json) {
		if (StringUtils.isEmpty(json)) {
			return null;
		}
		return JSON.parseObject(json, Map.class);
	}
}
